package com.googlecode.flealancemarket.service.commands.impl;

import com.googlecode.flealancemarket.metamodel.Job;
import com.googlecode.flealancemarket.service.commands.SaveJob;
import com.googlecode.flealancemarket.service.facades.JobFacade;

public class SaveJobImpl implements SaveJob {

    private Job job;
    private long authorId;
    private long categoryId;
    private JobFacade facade;

    public void setJob(Job j) {
        this.job = j;
    }

    public Job getJob() {
        return this.job;
    }

    public Job execute() {
        return getFacade().saveJob(job, authorId, getCategoryId());
    }

    public long getAuthorId() {
        return this.authorId;
    }

    public void setAuthorId(long id) {
        this.authorId = id;
    }

    public long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(long categoryId) {
        this.categoryId = categoryId;
    }

    public JobFacade getFacade() {
        return facade;
    }

    public void setFacade(JobFacade facade) {
        this.facade = facade;
    }

}
